﻿using GLstudent.DAL;
using GLstudent.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace GLstudent.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class dengluController : ControllerBase
    {
        private DAL_denglu dal = new DAL_denglu();
        /// <summary>
        /// 登录的方法
        /// </summary>
        /// <param name="yonghu">用户名</param>
        /// <returns></returns>
        [HttpPost]
        public denglu chaxun(denglu yonghu)
        {
            return dal.Select(yonghu);
        }
        /// <summary>
        /// 注册教师用户的方法
        /// </summary>
        /// <param name="zengjia">对应denglu类的参数</param>
        /// <returns></returns>
        [HttpPost]
        public int zhucejiaoshi(denglu zengjia)
        {
            return dal.TInsert(zengjia);
        }
        /// <summary>
        /// 注册学生用户的方法
        /// </summary>
        /// <param name="zengjia">对应denglu类的参数</param>
        /// <returns></returns>
        [HttpPost]
        public int zhucexuesheng(denglu zengjia)
        {
            return dal.SInsert(zengjia);
        }
    }
}
